package com.example.testproject.ext

import android.content.Context
import android.util.TypedValue

/**
 *
 * @ClassName: ContextExt
 * @Author: android 超级兵
 * @CreateDate: 10/21/21$ 2:23 PM$
 * TODO Context 扩展
 */

fun Context.toDip(value: Float) = let {
    TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, this.resources.displayMetrics)
}
